package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class AccountUpdateRequest extends BaseTokenRequest {

    public static final String PATH = BaseRequest.PATH + "api/set_user_info";

    private Change[] changes;

    public Change[] getChanges() {
        return changes;
    }

    public void setChanges(Change[] changes) {
        this.changes = changes;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        AccountUpdateRequestBody body = new AccountUpdateRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setChanges(changes);
        return body;
    }

    private class AccountUpdateRequestBody extends BaseTokenRequestBody {

        @SerializedName("Changes")
        private Change[] changes;

        private AccountUpdateRequestBody() {
            setSv(BaseRequestConfig.SV_ACCOUNT_UPDATE);
        }

        public Change[] getChanges() {
            return changes;
        }

        public void setChanges(Change[] changes) {
            this.changes = changes;
        }
    }

}
